<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        * {
            margin: 0px;
            padding: 0px;
        }
        
        #nbaPlay {
            width: 250px;
            margin: auto;
        }
        
        #curry,
        #abc {
            height: 178px;
            width: 112px;
            border: rgba(0, 0, 0, 0.12) solid 1px;
            float: left;
            margin: 5px;
        }
        
        .teamImg {
            width: 16px;
            height: 16px;
        }
        
        #curryImg,
        #curry,
        #abcImg,
        #abc {
            border-radius: 10px;
            text-align: center;
        }
        
        .name {
            font-size: 14px;
        }
        
        .type,
        .team {
            font-size: 12px;
            color: #70757a;
        }
    </style>
</head>

<body>
    <!-- 整体架构:一个大div(控制居中) width:250px
    套两个div(人物信息) 
    人物卡边框border:rgba(0, 0, 0, .12) solid 1px
    卡牌大小： height: 178px;width: 112px;
    两个人物卡间隔：10px
    人物图片大小：112X112；
    队logo大小：16X16；
    人物图片、人物卡边角：border-radius: 10px; 
    字体样式：文本居中；curry :font-size: 14px;
    控球后卫、金州勇士：font-size: 12px; color: #70757a; -->

    <div id="nbaPlay">

        <div id="curry">
            <img src="" alt="curry img" id="curryImg">
            <br>
            <span class="name"></span> <br>
            <span class="type"> </span> <br>
            <img src="" alt="" class="teamImg">
            <span class="team"></span>
        </div>
        <div id="abc">
            <img src="" alt="abc img" id="abcImg">
            <br>
            <span class="name"></span> <br>
            <span class="type"> </span> <br>
            <img src="" alt="" class="teamImg">
            <span class="team"></span>
        </div>
        <p align="center">&copy;版权由wht归属，未经允许不得复制、镜像</p>
    </div>
    <hr>
    <script>
        //构建函数
        function Star(name, type, team, personImg, teamImg) {
            this.name = name;
            this.type = type;
            this.team = team;
            this.personImg = personImg;
            this.teamImg = teamImg;

        }
        //实例化对象
        var curry = new Star('Curry', '控球后卫', '金州勇士', 'https://gitee.com/WuShi269/interactive-web-design/blob/master/img/curryImg.jpg', 'https://gitee.com/WuShi269/interactive-web-design/blob/master/img/curryTeamImg.png');
        //选中图片
        var curryImgItem = document.getElementById('curryImg');
        curryImgItem.src = curry.personImg;
        //选中姓名
        var nameArr = document.getElementsByClassName('name')
            //curry位置
        var curryName = nameArr[0];
        curryName.innerHTML = curry.name;
        //位置
        var typeArr = document.getElementsByClassName('type');
        var curryType = typeArr[0];
        curryType.innerHTML = curry.type;
        //队图片
        var teamImgArr = document.getElementsByClassName('teamImg');
        var curryTeamImg = teamImgArr[0];
        curryTeamImg.src = curry.teamImg;
        //队名
        var teamArr = document.getElementsByClassName('team');
        var curryTeam = teamArr[0];
        curryTeam.innerHTML = curry.team;


        //实例化对象
        var abc = new Star('字母哥', '前锋', '密尔沃基雄鹿', 'https://gitee.com/WuShi269/interactive-web-design/blob/master/img/abcImg.jpg', 'https://gitee.com/WuShi269/interactive-web-design/blob/master/img/abcTeamImg.png');
        //选中图片
        var abcImgItem = document.getElementById('abcImg');
        abcImgItem.src = abc.personImg;
        //选中姓名
        var nameArr = document.getElementsByClassName('name')
            //abc位置
        var abcName = nameArr[1];
        abcName.innerHTML = abc.name;
        //位置
        var typeArr = document.getElementsByClassName('type');
        var abcType = typeArr[1];
        abcType.innerHTML = abc.type;
        //队图片
        var teamImgArr = document.getElementsByClassName('teamImg');
        var abcTeamImg = teamImgArr[1];
        abcTeamImg.src = abc.teamImg;
        //队名
        var teamArr = document.getElementsByClassName('team');
        var abcTeam = teamArr[1];
        abcTeam.innerHTML = abc.team;
    </script>


</body>

</html>